package com.ruoyi.charge.controller;

import java.util.List;
import java.util.Arrays;

import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.charge.vo.CashProportionVo;
import com.ruoyi.charge.bo.CashProportionQueryBo;
import com.ruoyi.charge.bo.CashProportionAddBo;
import com.ruoyi.charge.bo.CashProportionEditBo;
import com.ruoyi.charge.service.ICashProportionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 分佣比例管理Controller
 *
 * @author fanqie
 * @date 2021-10-25
 */
@Api(value = "分佣比例管理控制器", tags = {"分佣比例管理管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/charge/cash_proportion")
public class CashProportionController extends BaseController {

    private final ICashProportionService iCashProportionService;

    /**
     * 查询分佣比例管理列表
     */
    @ApiOperation("查询分佣比例管理列表")
    @GetMapping("/list")
    public TableDataInfo<CashProportionVo> list(CashProportionQueryBo bo) {
        startPage();
        List<CashProportionVo> list = iCashProportionService.queryList(bo);
        return getDataTable(list);
    }


    /**
     * 获取分佣比例管理详细信息
     */
    @ApiOperation("获取分佣比例管理详细信息")
    @GetMapping("/{id}")
    public AjaxResult<CashProportionVo> getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(iCashProportionService.queryById(id));
    }



}
